﻿import request from '/@/utils/request';
enum Api {
  AddGType = '/api/gType/add',
  DeleteGType = '/api/gType/delete',
  BatchDeleteGType = '/api/gType/batchDelete',
  UpdateGType = '/api/gType/update',
  ImportGType = '/api/gType/import',  
  DownLoadGType = '/api/GType/DownLoad',
  PageGType = '/api/gType/page',
}
// 导入
export const importGType = (params?: any) => {
	const formData = new FormData();
	formData.append('file', params);
	// 请求配置
	const config = {
		headers: {
		},
	};
	request({
		url: Api.ImportGType,
		method: 'post',
		headers:{'Content-Type' : 'multipart/form-data'},
		data: formData,
		// data:formData
	});
}
// 增加构型图
export const addGType = (params?: any) =>
	request({
		url: Api.AddGType,
		method: 'post',
		data: params,
	});

// 删除构型图
export const deleteGType = (params?: any) => 
	request({
			url: Api.DeleteGType,
			method: 'post',
			data: params,
		});
// 批量删除构型图
export const batchDeleteGType = (params?: any) => 
	request({
			url: Api.BatchDeleteGType,
			method: 'post',
			data: params,
		});

// 编辑构型图
export const updateGType = (params?: any) => 
	request({
			url: Api.UpdateGType,
			method: 'post',
			data: params,
		});

// 分页查询构型图
export const pageGType = (params?: any) => 
	request({
			url: Api.PageGType,
			method: 'post',
			data: params,
		});
//下载构型图模板
export const downLoadGType = (params?: any) => 
	request({
			url: Api.DownLoadGType,
			method: 'post',
			data: params,
			responseType: 'blob',
		});

